Skip to content

Instantly share code, notes, and snippets.

@karlhorky
karlhorky / migrate-to-eslint-plugin-import-x.diff
Last active May 21, 2024 13:05
Migrate from eslint-plugin-import to eslint-plugin-import-x
// Migrate from eslint-plugin-import (no ESLint v9 support, multiple issues and missing features)
// to eslint-plugin-import-x
//
// - https://www.npmjs.com/package/eslint-plugin-import
// - https://www.npmjs.com/package/eslint-plugin-import-x
// First, install `eslint-plugin-import-x` (and for TypeScript support, `@typescript-eslint/parser`)
-import eslintImport from 'eslint-plugin-import';
+import eslintImportX from 'eslint-plugin-import-x';
@ArnoutDevos
ArnoutDevos / Remove_notebook_checkpoints.sh
Created December 7, 2018 10:08
command to remove automatically created .ipynb_checkpoints folders and their checkpoints
rm -rf `find -type d -name .ipynb_checkpoints`
@w3core
w3core / brightnessByColor.js
Created December 8, 2016 08:52
Calculate brightness value by RGB or HEX color
/**
* Calculate brightness value by RGB or HEX color.
* @param color (String) The color value in RGB or HEX (for example: #000000 || #000 || rgb(0,0,0) || rgba(0,0,0,0))
* @returns (Number) The brightness value (dark) 0 ... 255 (light)
*/
function brightnessByColor (color) {
var color = "" + color, isHEX = color.indexOf("#") == 0, isRGB = color.indexOf("rgb") == 0;
if (isHEX) {
var m = color.substr(1).match(color.length == 7 ? /(\S{2})/g : /(\S{1})/g);
if (m) var r = parseInt(m[0], 16), g = parseInt(m[1], 16), b = parseInt(m[2], 16);
@mildsunrise
mildsunrise / README.md
Last active May 21, 2024 13:02
Documentation of Tuya's weird compression scheme for IR codes

[Tuya][]'s IR blasters, like the [ZS08][], have the ability to both learn and blast generic IR codes. These IR codes are given to the user as an opaque string, like this:

A/IEiwFAAwbJAfIE8gSLIAUBiwFAC+ADAwuLAfIE8gSLAckBRx9AB0ADBskB8gTyBIsgBQGLAUALA4sB8gRAB8ADBfIEiwHJAeARLwHJAeAFAwHyBOC5LwGLAeA97wOLAfIE4RcfBYsB8gTyBEAFAYsB4AcrCYsB8gTyBIsByQHgPY8DyQHyBOAHAwHyBEAX4BVfBIsB8gTJoAMF8gSLAckB4BUvAckB4AEDBfIEiwHJAQ==

Not much is known about the format of these IR code strings, which makes it difficult to use codes obtained through other means (such as a

Pipeline still running ...
PipelineRun is still running: Tasks Completed: 29 (Failed: 0, Cancelled 0), Incomplete: 1, Skipped: 22
[get-pr-number : parse-pr-url] + echo -n 245
[get-pr-number : parse-pr-url] + tee /tekton/results/git_pr_number
[get-pr-number : parse-pr-url] 245
[acquire-lease : create-lease] + calculate_duration_in_seconds 90m
[acquire-lease : create-lease] + '[' m == m ']'
[acquire-lease : create-lease] + TOTAL_DURATION_IN_SECONDS=5400
[acquire-lease : create-lease] + export TOTAL_DURATION_IN_SECONDS
@rxaviers
rxaviers / gist:7360908
Last active May 21, 2024 13:02
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@stenito
stenito / publicip.php
Last active May 21, 2024 13:01
Get public IP address (or wan IP address) with php function
<?php
function getPublicIP() {
// create & initialize a curl session
$curl = curl_init();
// set our url with curl_setopt()
curl_setopt($curl, CURLOPT_URL, "http://httpbin.org/ip");
// return the transfer as a string, also with setopt()
@onhate
onhate / pre-signup.ts
Last active May 21, 2024 13:00
Merge AWS Cognito External Provider User with Cognito User on Pre SignUp
import { PreSignUpTriggerEvent, PreSignUpTriggerHandler } from 'aws-lambda';
import { CognitoIdentityServiceProvider } from 'aws-sdk';
const cognito = new CognitoIdentityServiceProvider();
const knownProviderNames = {
google: 'Google',
facebook: 'Facebook'
};
@3xocyte
3xocyte / dementor.py
Last active May 21, 2024 12:59
rough PoC to connect to spoolss to elicit machine account authentication
#!/usr/bin/env python
# abuse cases and better implementation from the original discoverer: https://github.com/leechristensen/SpoolSample
# some code from https://www.exploit-db.com/exploits/2879/
import os
import sys
import argparse
import binascii
import ConfigParser
@donvito
donvito / main.go
Last active May 21, 2024 12:58
AES-256 encrypt/decrypt in Go
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
)